package org.little.test.service;
import org.little.test.model.Books;
import org.little.test.repository.BooksRepository;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;


/**
 * Created by liuhongtao on 2017/8/6.
 */

@Component
@Transactional
public class BookService {
    private static final Logger LOG = LoggerFactory.getLogger(BookService.class);

    @Autowired
    private BooksRepository booksRepository;

    public void doSaveBook(Books bookInstance){
        Books resultInstance = booksRepository.save(bookInstance);
        LOG.info("新建boos={}",resultInstance);
    }

}
